# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=postgresql-plpgsql_check
_pkgname=plpgsql_check
pkgver=2.1.6
pkgrel=0
pkgdesc="Additional tools for plpgsql functions validation"
url="https://github.com/okbob/plpgsql_check"
arch="all"
license="MIT"
makedepends="postgresql-dev"
subpackages="$pkgname-doc"
source="$_pkgname-$pkgver.tar.gz::https://github.com/okbob/$_pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"
options="!check"  # XXX: installcheck requires running PostgreSQL

build() {
	make USE_PGXS=1 all
}

package() {
	depends="postgresql$(pg_config --major-version)"

	make USE_PGXS=1 DESTDIR="$pkgdir" install

	install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses
}

sha512sums="
1c9486bf45b12d58e104d1e7e1cda7d026097458dd9e8b47915089c9b0408384855c786ccc08fb8f8aa82b5aa96c8730dff395e7970db081de9f52bf1f38e96a  plpgsql_check-2.1.6.tar.gz
"
